{include file="bushen/top" /}
<!--<style>-->
<!--    .tab-top-label{-->
<!--        flex-wrap: wrap;-->
<!--    }-->
<!--    .tab-label{-->
<!--        padding: 0 10px;-->
<!--        border: 1px solid #ccc;-->
<!--        width:auto;-->
<!--        height:auto;-->
<!--        min-width: 100px;-->
<!--        min-height: 30px;-->
<!--        margin-bottom: 20px;-->
<!--    }-->
<!--    .ff{-->
<!--        display: flex;-->
<!--        flex-wrap: wrap;-->
<!--        margin-right: 40px;-->
<!--    }-->
<!--</style>-->
<input type="hidden" id="bids" value="{$row.id}">
<div class="tabs">
    <div class="tab-top-label">
        <div class="ff">
        {include file="bushen/table_top" /}
        </div>
        {if $row.task_1 != 0}
<!--        <div class="ff">-->
            <label class="tab-label" for="tab5">本车车损</label>
<!--        </div>-->


        {/if}
        {if count($sanche) != 0}
<!--        <div class="ff">-->
            <label class="tab-label" for="tab6">三者车损</label>
<!--        </div>-->
        {/if}
        {if count($scwusun) != 0}
<!--        <div class="ff">-->
        <label class="tab-label" for="tab7">三者财务损失</label>
<!--        </div>-->
        {/if}

        {if count($benren) != 0}
<!--            <div class="ff">-->
        <label class="tab-label" for="tab8">本车人伤</label>
<!--            </div>-->
        {/if}

        {if count($sanren) != 0}
<!--                <div class="ff">-->
        <label class="tab-label" for="tab9">三者人伤</label>
<!--                </div>-->
        {/if}

    </div>

    <div class="tabs-content">
        {include file="bushen/table_con" /}
        <!--本车损失-->
        {if $row.task_1 != 0}
        {include file="bushen/jiean/benche" /}
        {/if}

        <!--三者车-->
        {if count($sanche) != 0}
        {include file="bushen/jiean/sanzheche" /}
        {/if}

        <!--三者财务损失-->
        {if count($scwusun) != 0}
        {include file="bushen/jiean/sanzhecai" /}
        {/if}

        <!--本车人伤-->
        {if count($benren) != 0}
        {include file="bushen/jiean/benren" /}
        {/if}

        <!--三者人伤-->
        {if count($sanren) != 0}
        {include file="bushen/jiean/sanzheren" /}
        {/if}


    </div>
</div>

<form id="zhuxiaobeizhu-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <input type="hidden" name="row[id]" value="{$row.id}">
    {if $row['status'] == 6}
        <div class="tab-labels">
            <div class="xian"></div>
            注销备注
        </div>
        <div class="hang">
            <div class="form-group" style="width: 100%!important;">
                <label class="control-label col-xs-12 col-sm-2">{:__('注销备注')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <textarea class="form-control"  name="row[zhuxiao_beizhu]" type="text" rows="5" value="" readonly  style="background-color: #fff">{$row.zhuxiao_beizhu}</textarea>
                </div>
            </div>
        </div>
    {/if}
    {if $row['status'] == 7}
    <div class="tab-labels">
        <div class="xian"></div>
        拒赔备注
    </div>
    <div class="hang">
        <div class="form-group" style="width: 100%!important;">
            <label class="control-label col-xs-12 col-sm-2">{:__('拒赔备注')}:</label>
            <div class="col-xs-12 col-sm-10">
                <textarea class="form-control"  name="row[jupei_beizhu]" type="text" rows="5" value="" readonly  style="background-color: #fff">{$row.jupei_beizhu}</textarea>
            </div>
        </div>
    </div>
    {/if}


    {if $type == 1}
    <div>
        <div class="conts" style="margin-top:20px">
            <span style="width:98%;margin: 1%;">审核意见</span>
            <textarea name="audit_reason" id="audit_reason" cols="30" rows="10"
                      style="width:98%;height: 100px;margin: 1%;"></textarea>
        </div>
        <div class="btns1">
            <button class="tongbtn" type="button" onclick="shenhe_ok(this)">通过审核</button>
            <button class="tuibtn" type="button" onclick="shenhe_no(this)">退回</button>
        </div>
    </div>
    {/if}
</form>
{include file="bushen/yijian" /}

<style>
    .btns1 {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btns1 button {
        border: 0px;
        padding: 5px 10px;
        border-radius: 4px;
    }

    .btns1 .tongbtn {
        background: #FF5722;
        color: #fff;
        margin-right: 15px;
    }

    .btns1 .tuibtn {
        background: green;
        color: #fff;
    }
</style>
<script type="text/javascript">
    function shenhe_no(obj) {
        var audit_reason = $('#audit_reason').val();
        if (audit_reason == '') {
            layer.msg("请输入审核原因");
            return false
        }
        layer.confirm('确定' + $(obj).text() + '？', {icon: 3, title: $(obj).text()}, function (index) {
            var id = {$orderid};
            var tuihui = audit_reason;
            $.ajax({
                type: "POST",//方法类型
                dataType: "json",//预期服务器返回的数据类型
                url: "{:url('bushen/jupei/tuihui')}",//url
                data: {id: id, tuihui: tuihui},
                success: function (res) {
                    if (res.code == 1) {
                        layer.msg(res.msg, {time: 2000}, function () {
                            layer.closeAll()
                            parent.layer.closeAll();
                            parent.$("#table").bootstrapTable('refresh', {});
                        });
                    } else {
                        layer.msg(res.msg);
                    }
                }
            });
        });

    }

    function shenhe_ok(obj) {
        var audit_reason = $('#audit_reason').val();
        if (audit_reason == '') {
            layer.msg("请输入审核原因");
            return false
        }
        layer.confirm('确定' + $(obj).text() + '？', {icon: 3, title: $(obj).text()}, function (index) {
            var id = {$orderid};
            var tuihui = audit_reason;
            $.ajax({
                type: "POST",//方法类型
                dataType: "json",//预期服务器返回的数据类型
                url: "{:url('bushen/jupei/shen')}",//url
                data: {id: id, tuihui: tuihui},
                success: function (res) {
                    if (res.code == 1) {
                        layer.msg(res.msg, {time: 2000}, function () {
                            layer.closeAll()
                            parent.layer.closeAll();
                            parent.$("#table").bootstrapTable('refresh', {});
                        });
                    } else {
                        layer.msg(res.msg);
                    }
                }
            });
        });
    }

</script>
